/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cr.ac.una.sive.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


@Entity
@Table(name = "VEHICULO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Vehiculo.findAll", query = "SELECT v FROM Vehiculo v"),
    @NamedQuery(name = "Vehiculo.findByIdVehiculo", query = "SELECT v FROM Vehiculo v WHERE v.idVehiculo = :idVehiculo"),
    @NamedQuery(name = "Vehiculo.findByPlaca", query = "SELECT v FROM Vehiculo v WHERE v.placa = :placa"),
    @NamedQuery(name = "Vehiculo.findByModelo", query = "SELECT v FROM Vehiculo v WHERE v.modelo = :modelo"),
    @NamedQuery(name = "Vehiculo.findByAnoFabricacion", query = "SELECT v FROM Vehiculo v WHERE v.anoFabricacion = :anoFabricacion"),
    @NamedQuery(name = "Vehiculo.findByColor", query = "SELECT v FROM Vehiculo v WHERE v.color = :color"),
    @NamedQuery(name = "Vehiculo.findByMarca", query = "SELECT v FROM Vehiculo v WHERE v.marca = :marca"),
    @NamedQuery(name = "Vehiculo.findByEstado", query = "SELECT v FROM Vehiculo v WHERE v.estado = :estado"),
    @NamedQuery(name = "Vehiculo.findByParqueo", query = "SELECT v FROM Vehiculo v WHERE v.parqueo = :parqueo")})
public class Vehiculo implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_VEHICULO")
    private BigDecimal idVehiculo;
    @Size(max = 100)
    @Column(name = "PLACA")
    private String placa;
    @Size(max = 100)
    @Column(name = "MODELO")
    private String modelo;
    @Column(name = "ANO_FABRICACION")
    private BigInteger anoFabricacion;
    @Size(max = 100)
    @Column(name = "COLOR")
    private String color;
    @Size(max = 100)
    @Column(name = "MARCA")
    private String marca;
    @Column(name = "ESTADO")
    private Character estado;
    @Size(max = 100)
    @Column(name = "PARQUEO")
    private String parqueo;
    @OneToMany(mappedBy = "vehiculo")
    private Collection<Marchamo> marchamoCollection;

    public Vehiculo() {
    }

    public Vehiculo(BigDecimal idVehiculo) {
        this.idVehiculo = idVehiculo;
    }

    public BigDecimal getIdVehiculo() {
        return idVehiculo;
    }

    public void setIdVehiculo(BigDecimal idVehiculo) {
        this.idVehiculo = idVehiculo;
    }

    public String getPlaca() {
        return placa;
    }

    public void setPlaca(String placa) {
        this.placa = placa;
    }

    public String getModelo() {
        return modelo;
    }

    public void setModelo(String modelo) {
        this.modelo = modelo;
    }

    public BigInteger getAnoFabricacion() {
        return anoFabricacion;
    }

    public void setAnoFabricacion(BigInteger anoFabricacion) {
        this.anoFabricacion = anoFabricacion;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        this.marca = marca;
    }

    public Character getEstado() {
        return estado;
    }

    public void setEstado(Character estado) {
        this.estado = estado;
    }

    public String getParqueo() {
        return parqueo;
    }

    public void setParqueo(String parqueo) {
        this.parqueo = parqueo;
    }

    @XmlTransient
    public Collection<Marchamo> getMarchamoCollection() {
        return marchamoCollection;
    }

    public void setMarchamoCollection(Collection<Marchamo> marchamoCollection) {
        this.marchamoCollection = marchamoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idVehiculo != null ? idVehiculo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vehiculo)) {
            return false;
        }
        Vehiculo other = (Vehiculo) object;
        if ((this.idVehiculo == null && other.idVehiculo != null) || (this.idVehiculo != null && !this.idVehiculo.equals(other.idVehiculo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cr.ac.una.sive.entidad.Vehiculo[ idVehiculo=" + idVehiculo + " ]";
    }
    
}
